home *** CD-ROM | disk | FTP | other *** search
- Path: news.mira.net.au!news
- From: davidw@werple.net.au (David White)
- Newsgroups: comp.lang.c++
- Subject: Re: Pure virtual destructors?
- Date: 16 Apr 1996 20:32:11 +1000
- Organization: Werple Internet, Melbourne
- Message-ID: <4kvsvb$bf@werple.net.au>
- References: <4kuq0i$p6t@ftp.ee.vill.edu>
- NNTP-Posting-Host: werplez.mira.net.au
-
- sheridan@monet.vill.edu writes:
-
-
- >The rule with destructors is that they are always overridden, right?
- >That's a quote from VC4 docs, BTW. When I do this:
-
- >class CBase {
- >public:
- > virtual ~CBase() = 0;
- >...};
-
- >class CChild : public CBase {
- >public:
- > ~CChild();
- >...};
-
- >and declare a body for ~CChild, I always get unresolved external on
- >CBase::~CBase. I have seen this in several cases. My guess is it's not
- >a compiler bug, so what am I missing?
-
- >Thanks.
- >Pete Sheridan
-
- When a virtual function is declared pure, it doesn't necessarily mean that
- the class doesn't implement the function, it means only that some derived
- class must implement it. You are free to provide an implementation for any
- pure virtual function. In the case of virtual destructors, you have to
- provide an implementation whether you declare it pure or not.
-
- David White
- davidw@werple.mira.net.au
-
-
-